package steed.springboot.filter;

import java.net.URL;
import java.util.Enumeration;

import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebFilter;

import steed.filter.StrutsFilter;
import steed.util.base.BaseUtil;

@WebFilter(urlPatterns={"*.act"},filterName="f0")
public class F0StrutsFilter extends StrutsFilter{

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
        ClassLoader contextClassLoader2 = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader2.getClass().getName().contains("TomcatEmbeddedWebappClassLoader")) {
			try {
				
				Enumeration<URL> resources = contextClassLoader2.getResources("");
				while (resources.hasMoreElements()) {
					URL url = (URL) resources.nextElement();
					BaseUtil.getLogger().debug("json-->"+url);
				}
				Thread.currentThread().setContextClassLoader(contextClassLoader2.getParent());
			} catch (Exception e) {
			}
		}
		super.init(filterConfig);
		/*try {
			Thread.currentThread().setContextClassLoader(contextClassLoader2);
		} catch (Exception e) {
		}*/
	}

}
